home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextLibrary / Documentation / NextDev / Examples / MiG / Server / add_lookup.c next >
Encoding:
Text File  |  1995-01-27  |  647 b   |  27 lines

  1. /* add_look_up.c:  Contains a library routine to look up the add server. */
  2.  
  3. #import "../Library/add_types.h"
  4.  
  5. /* This function finds the port that the add service has advertised. */
  6. port_t    add_look_up()
  7. {
  8.     port_t            port;
  9.     kern_return_t   ret;    
  10.      
  11.     /* 
  12.      * Use "" instead of "*", so we look only on this machine.
  13.      * (That way, we won't run into someone else who's testing 
  14.      * this server.)
  15.      */
  16.     ret = netname_look_up(name_server_port, "", ADD_SERVER_NAME, &port);
  17.     
  18.     if (ret != KERN_SUCCESS)
  19.     {
  20.         /* Print the network name server's error message. */
  21.         mach_error("Lookup of add server failed", ret);    
  22.         return PORT_NULL;
  23.     }
  24.     return port;
  25. }
  26.  
  27.